package org.changwang.String;

/**
 * @ClassName StringBuilderUse
 * @Description
 * @Author c.w
 * @Date 2025/7/24 10:38
 * @Version 1.0.0
 */
public class StringBuilderUse {
	public static void main(String[] args) {
		appendTest1();
	}
	/**
	 * 测试append方法
	 */
	public static void appendTest1(){
		long start = System.currentTimeMillis();
		StringBuilder sb = new StringBuilder();
		String str = "#";
		for (int i = 0; i < 1000000; ) {
			sb.append(str).append("-").append(i);
			i++;
		}
		long end = System.currentTimeMillis();
		System.out.println(sb);
		System.out.println("append方法耗时：" + (end - start));
	}
}